
var headerObj = {};

headerObj.changePasswordLayer = null;
headerObj.changePassword = function() {
	headerObj.changePasswordLayer = layer.open({
		type : 1,
		title : commonI18n.Change_password,
		shadeClose : true,
		move : false,
		area : [ '500px', '260px' ],
		content : $('#changePasswordLayer'),
		zIndex : 2,
		shade: 0
	});
	$('#oldPassword').val("");
	$('#newPassword1').val("");
	$('#newPassword2').val("");
}
headerObj.saveNewPassword = function() {
	var oldPassword=$('#oldPassword').val();
	var newPassword1=$('#newPassword1').val();
	var newPassword2=$('#newPassword2').val()
	if (oldPassword !== "" && newPassword1 != "" && newPassword2 != "") {// 密码不为空
		if (newPassword1 == newPassword2) {// 新旧密码相同
					var url = 'sys/changePassword';
					var data = {
						oldPassword :oldPassword,
						newPassword :newPassword1,
					};
					var successCallBack = function(data) {
						if (data.result == true) {
							sysShowSuccessTip(commonI18n.Save_success);
							parent.layer.close(headerObj.changePasswordLayer);
						} else
							sysShowErrorTip(commonI18n.Password_Error);
					};
					$.sysAjax(url, data, successCallBack);
		} else {
			sysShowErrorTip(commonI18n.Diffrent_Password);
		}
	} else {
		sysShowErrorTip(commonI18n.Password_Null);
	}
}
headerObj.closeChangePassword = function() {
	parent.layer.close(headerObj.changePasswordLayer);
}